#include <iostream>
#include <cstdio>
#include <map>
#include <algorithm>
using namespace std;

struct Food {
	int number;
	int totalPrice;
	double value;
};

bool cmp(const Food &a, const Food &b) {
	return a.value > b.value;
}

int main(void) {

	int n, d, tmp;
	float result = 0.0;

	scanf("%d%d", &n, &d);
	int remainNumber = d;
	Food *food = new Food[n];

	for(int i = 0; i < n; i++) {
		scanf("%d", &tmp);
		food[i].number = tmp;
	}
	for(int i = 0; i < n; i++) {
		scanf("%d", &tmp);
		food[i].totalPrice = tmp;
		food[i].value = (double) tmp / (food[i].number * 1.0);
	}

	sort(food, food + n, cmp);

	for (int i = 0; i < n; i++) {
		if (food[i].number < remainNumber) {
			result += food[i].totalPrice;
			remainNumber -= food[i].number;
		} else if (food[i].number > remainNumber) {
			result += food[i].value * (remainNumber);
			break;
		} else {
			result += food[i].totalPrice;
			remainNumber -= food[i].number;
			break;
		}
		
	}

	printf("%.2f\n", result);

    
    return 0;
}